const mongoose = require('mongoose')
const adminSchema = new mongoose.Schema({
  username: { type: String, require: true, },
  password: {
    type: String,
    select: false,
    //自定义修改和保持 把获得的值修改后再保存
    set(value) {
      return require('bcrypt').hashSync(value, 10)
    }
  }
})
const AdminUser = mongoose.model('AdminUser', adminSchema)
module.exports = AdminUser